﻿using System.Collections.Generic;
using System.Linq;
using Complaint.Models.Dtos;
using Complaint.Repositories;

namespace Complaint.Models
{
    public class PasswordQuestionModel : BaseModel<PasswordQuestionRepository>,
        IModel<PasswordQuestion>
    {
        #region Implementation of IModel<PasswordQuestion>

        public IList<PasswordQuestion> Retrieve()
        {

            return Repository.FindAll().ToList();
        }

        public void Create(PasswordQuestion dto)
        {

            Repository.Create(dto);
        }

        public void Update(PasswordQuestion dto)
        {

            Repository.Update(dto);
        }

        public void Delete(PasswordQuestion dto)
        {

            Repository.Delete(dto);
        }

        public IList<PasswordQuestion> FindByName(string name)
        {

            return Repository.FindByName(name).ToList();
        }

        public PasswordQuestion FindById(int id)
        {

            return Repository.FindById(id);
        }

        #endregion
    }
}